$('button').click(function(){
    setLogin();
    return false;
 });

 async function setLogin(){
   let res=await myPromiseAjax('../server/goods_login.php','post',{userName:$('[name="name"]').val(),userPwd:$('[name="pwd"]').val()},'json');
   if(res.result === 1){
     mySetCookie('login','1',7*247*60*60,'/');
     window.alert('恭喜成功登录，跳转首页面');
     window.location.href='./index.html';
   }else{
     window.alert('登录失败，请重新登录');
   }
 }